package com.cloudbroker.openapi.manage.controller;

import com.cloudbroker.bcs.platform.ltb.bizapi.service.chat.back.ChatMessageHistoryResult;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.chat.vo.ChatMessageHistoryQueryForm;
import com.cloudbroker.bcs.platform.ltb.bizapi.t2service.social.ChatT2BizService;
import com.cloudbroker.bcs.platform.ltb.bizexport.t2.social.ChatT2;
import com.cloudbroker.bcs.platform.ltb.common.ext.annotation.SaveLog;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import static com.cloudbroker.bcs.platform.ltb.common.util.RequestUtil.getSingleParameterMapForBody;

/**
 * Created by world on 17/1/17.
 */
@Controller
public class ChatController {
    @Resource
    private ChatT2BizService chatT2BizService;

    @ResponseBody
    @RequestMapping("/chat_message_history")
    @SaveLog(remark = "聊天历史")
    public ChatMessageHistoryResult getChatMessageHistory(HttpServletRequest request, String jsonpcallback){
        ChatMessageHistoryQueryForm form = getSingleParameterMapForBody(request, ChatMessageHistoryQueryForm.class);
        return chatT2BizService.getChatMessageHistory(form);
    }

}
